<div ng-controller="waitAndRecieveOrderController">
    <div class="modal fade" id="myModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">提示消息</h4>
                </div>
                <div class="modal-body">
                    <p>您有订单被拒绝，是否需要查看详情？</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">否</button>
                    <a type="button" class="btn btn-danger" href="historicalOrders">是</a>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
    <div class="contain">
        <div class="container-fluid">
            <div class="container">
                <h2>My Order--wait for order</h2>
                <hr>
                <div class="row">
                    <!-- dish title-->
                    <table class="table table-striped table-title">
                        <tr style="background-color: #D64B2A;color: white;">
                            <td colspan="2" class="td-dish">Dish</td>
                            <td class="td-price">Price</td>
                            <td class="td-number">Number</td>
                            <td class="td-sum">Sum</td>
                            <td class="td-status">Order Status</td>
                            <td class="td-option">Order Option</td>
                        </tr>
                    </table>
                    <div ng-repeat="order in waitingForReceivingOrders">
                        <!--<c:forEach var="order" items="{{waitingForReceivingOrders }}">-->
                        <div class="order-top"></div>
                        <table class="table table-content" id="{{order._id }}">
                            <tr class="order-info">
                                <td colspan="3">{{order.createDate }}</td>
                                <td colspan="4">{{order.merchant.mname }}</td>
                            </tr>

                            <!--<c:forEach var="items" items="${order.orderItems }">-->
                            <tr ng-repeat="item in order.orderItem">
                                <td style="vertical-align: middle;" class="td-img"><img
                                        src="{{constant.imgServer}}{{item.dish.img}}"
                                        alt="{{item.dname}}" class="dish-img"></td>
                                <td style="vertical-align: middle;" class="td-dName">{{item.dish.dname }}</td>
                                <td style="vertical-align: middle;" class="td-price">&yen;{{item.dish.price }}</td>
                                <td style="vertical-align: middle;" class="td-sum">{{item.num }}</td>
                                <td style="vertical-align: middle;">&yen;{{item.smallSum }}</td>

                                <!--<c:if test="${i==1 }">-->
                                <td ng-if="$index == 0" style="vertical-align: middle;"
                                    rowspan="{{order.orderItem.length }}"
                                    class="con-status" >{{order.status | orderStatusFilter }}
                                </td>
                                <td ng-if="$index == 0" style="vertical-align: middle;"
                                    rowspan="{{order.orderItem.length }}"
                                    class="con-option">
                                    <button ng-if="order.status==1" class="btn btn-danger option-btn"
                                            ng-click="confirmOrder(order, $parent.$index)">确认收货
                                    </button>
                                    <span ng-if="order.status==0" style="color : black"
                                          class="order-msg-span"><b>订单已提交</b></span>

                                </td>
                                <!--</c:if>-->
                            </tr>
                            <!--</c:forEach>-->
                            <!--</div>-->
                            <tr>
                                <td colspan="6"></td>
                                <td style="font-size: 20px;">Sum : <b>&yen;{{order.total }}</b></td>
                            </tr>
                        </table>

                        </c:forEach>
                    </div>
                </div>
                <!--container end-->
            </div>
        </div>

        <div id="sssModal" class="modal fade" role="dialog"
             aria-labelledby="gridSystemModalLabel">
            <div class="modal-dialog" role="document">
                <div class="login-bg">
                    <div class="contain">
                        <div class="modal-body">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                                <div class="container-fluid"></div>
                                <div class="module form-module">
                                    <div class="toggle">Complaints</div>
                                    <div class="form">
                                        <div>
                                            <h2>
                                                <img src="images/mark.png" width="5%" height="5%"> Mark
                                            </h2>
                                        </div>
                                        <form action="grade" method="post">
                                            <div class="goods-comm">
                                                <div class="goods-comm-stars">
												<span class="star_l"><h5>Please give your grade
                                                    for this ordering:</h5></span>

                                                    <div id="rate-comm-1" class="rate-comm"></div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="form l_text">
                                        <div>
                                            <h2>
                                                <img src="images/complain.png" width="8%" height="8%">
                                                Complaints
                                            </h2>
                                        </div>
                                        <label class="m_flo"></label>

                                        <form action="complain" method="post" id="complainform">
                                            <input id="mark-oid" type="text" value="0"
                                                   style="display: none" name="oid">
                                            <textarea name="complaints" form="complainform" class="text"></textarea>
                                            <input type="submit" value="Submit" id="complain-submit">
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>